class Solution {
    public int climbStairs(int n) {
        int next = 1;
        int prev = 1;
        int tem = 0;
        for(int i = 0;i<n;i++) {
            tem = next;
            next += prev;
            prev = tem;
        }
        return prev;
    }
}